/**
 * 插件初始滑
 */
import Application from 'koa'
import bodyparser from 'koa-bodyparser'
import json from 'koa-json'
import logger from 'koa-logger'
import config from '../config/dev'

import { join } from 'path';
import staticPublic from 'koa-static'
class Init {
     // 存放我们koa框架用到的所有插件
     private plugin: Array<Application.Middleware<Application.DefaultState & { },  Application.DefaultContext & {}>> = []

     constructor() {
        this.initPlugin()
    }

    initPlugin() {
        this.plugin=[
            bodyparser({
                enableTypes:['json', 'form', 'text']
            }),
            json(),
            staticPublic(join(__dirname,config.staticPath))
        ]
    }
    
}